/*
This file is for legacy code that I don't want to delete yet


        ROOM MOVER FROM BOARD.CPP, buildRoom()
        if (rooms[numrooms].y >= rooms[n].y) //collided room y is below current room y, move down
        {
          if (rooms[numrooms].x >= rooms[n].x) //collided room x is right of current room x, move right/down
          {
            rooms[numrooms].y += temproom.h+1;
            rooms[numrooms].x += temproom.w+1;
          } // end of x check if
          
          if (rooms[numrooms].x < rooms[n].x) //collided room x is left of current room x, move left/down
          {
            rooms[numrooms].y += temproom.h+1;
            rooms[numrooms].x -= temproom.w+1;
          } // end of 2nd x check if
          
        } // end of y check if
        
        if (rooms[numrooms].y < rooms[n].y) //collided room y is above current room y, move up
        {
          if (rooms[numrooms].x >= rooms[n].x) //collided room x is right of current room x, move right/down
          {
            rooms[numrooms].y -= temproom.h+1;
            rooms[numrooms].x += temproom.w+1;
          } // end of x check if
          
          if (rooms[numrooms].x < rooms[n].x) //collided room x is left of current room x, move left/down
          {
            rooms[numrooms].y -= temproom.h+1;
            rooms[numrooms].x -= temproom.w+1;
          } // end of 2nd x check if
          
        } // end of 2nd y check if
          debug("room moved");
          //Now that we moved the new room, check if it still collides with anything
        temproom = doRoomsCollide(rooms[numrooms],rooms[n]); //Temproom holds the rectangle of collision.
          debugint("2nd collision room x", temproom.x);
          debugint("2nd collision room y", temproom.y);
          debugint("2nd collision room w", temproom.w);
          debugint("2nd collision room h", temproom.h);
        
        if (temproom.x==-1) //passed 
        {
          roomsclear[n]=true;
            debug("passed second room check");
        }
        else
        {
          roomsclear[n]=false; //Start over with a new room.
            debug("failed second room check, fuck it, new random room");
        }
        
        
        =================================================================================
        
        OLD HALLWAY BUILDER CODE
  if (left >= right && !(top >= bottom)) 
  {
    //VERTICAL HALLWAY HERE
    int pos = rand()%left + (left-right); // Makes a random number between left and right sides
    seg1.x = pos;
    seg1.w = 1;
    if (one.y > two.y) //One is below two
    {
      seg1.y = two.y+two.h; //Start at the top
      seg1.h = two.y+two.h-one.y;
    }
    else //One is above two.
    {
      seg1.y = one.y+one.h;
      seg1.h = one.y+one.h-two.y;
    }
    if (checkCollideWithExistingRoom(seg1))
      return false; //Doesn't fit!
    //By this point the hallway is set up.
  }//End vertical hallway section
  
  else if (top >= bottom)
  {
    //HORIZONTAL HALLWAY HERE
    int pos = rand()%top + (top-bottom); //Makes a random number between top and bottom sides
    seg1.y = pos;
    seg1.h = 1;
    if (one.x < two.x) //One is to the left of two
    {
      seg1.x = one.x+one.h;
      seg1.w = one.x+one.h - two.x;
    }
    else
    {
      seg1.x = two.x+two.h;
      seg1.w = two.x+two.h - one.x;
    }
  } // end horizontal hallway section
  
  else 
  {
    //CORNERED HALLWAY HERE
    return false; //Not coding this yet for testing
  }
  
  //Positions should be set up by this point, just draw it to the data arrays.
  for (int x=seg1.x;x<seg1.x+seg1.w;x++)
  {
    for (int y=seg1.y;y<seg1.y+seg1.h;y++)
    {
      data[x][y].fcolor = 4;
      data[x][y].bcolor = 7;
      data[x][y].walkable = true;
    }// end of y for
  }// end of x for
  
        
        */
